var e = require("../../../@babel/runtime/helpers/toConsumableArray");

require("../../../@babel/runtime/helpers/Arrayincludes");

var t, r, n, i = require("../../../@babel/runtime/helpers/typeof");

module.exports = (t = {}, n = function(e, r) {
    if (!t[e]) return require(r);
    if (!t[e].status) {
        var n = {
            exports: {}
        };
        t[e].status = 1, t[e].func(t[e].req, n, n.exports), "object" === i(n.exports) ? (Object.keys(n.exports).forEach(function(r) {
            t[e].m.exports[r] = n.exports[r];
        }), n.exports.__esModule && Object.defineProperty(t[e].m.exports, "__esModule", {
            value: !0
        })) : t[e].m.exports = n.exports;
    }
    return t[e].m.exports;
}, (r = function(e, r, n) {
    t[e] = {
        status: 0,
        func: r,
        req: n,
        m: {
            exports: {}
        }
    };
})(1553308811261, function(e, t, r) {
    t.exports = e("./src/index.js");
}, function(e) {
    return n({
        "./src/index.js": 1553308811262
    }[e], e);
}), r(1553308811262, function(e, t, r) {
    var n = e("min-util"), i = new (e("./http"))();
    function u() {
        return i.request.apply(i, arguments);
    }
    for (var a in t.exports = u, i) {
        var o = i[a];
        n.isFunction(o) && (o = n.bind(o, i)), u[a] = o;
    }
}, function(e) {
    return n({
        "./http": 1553308811263
    }[e], e);
}), r(1553308811263, function(e, t, r) {
    var n = e("min-util"), i = e("min-url"), u = e("min-qs"), a = e("./queue"), o = e("./utils"), s = e("./adapters"), c = "application/x-www-form-urlencoded", d = o.CONTENT_TYPE_KEY, f = [ "get", "head", "delete", "options" ], h = [ "post", "put", "patch" ], p = [].concat(f, h);
    function l(e) {
        var t = this;
        this.defaults = {
            baseURL: "",
            timeout: 0,
            headers: {
                common: {}
            },
            withCredentials: !1
        }, n.each(p, function(e) {
            var r = t.defaults.headers[e] = {};
            n.includes(h, "method") && (r[e] = "application/json");
        }), this.interceptors = {
            request: new a(),
            response: new a()
        }, this.qs = u, this.init(e);
    }
    l.qs = u;
    var m = l.prototype;
    m.init = function(e) {
        e = n.extend({}, e), this.defaults.headers.common = e.headers || {}, delete e.headers, 
        n.extend(this.defaults, e);
    }, m.create = function(e) {
        return new l(e);
    }, m.request = function(e, t) {
        var r = this;
        if (n.isString(e)) return this.request(n.extend({
            url: e
        }, t));
        var a = e || {};
        a.headers = a.headers || {};
        var s = (a = n.extend({}, this.defaults, a)).baseURL + a.url;
        s = i.appendQuery(s, a.params);
        var f = n.toLower(a.method) || "get", h = this.defaults.headers, p = n.extend({}, h.common, h[f], a.headers), l = o.getContentType(p), m = l, x = a.data;
        n.isPlainObject(x) ? (l === c ? x = u.stringify(x) : "application/json" === l && (x = JSON.stringify(x)), 
        m || n.isString(x) && (m = c), n.isString(x) || (x = JSON.stringify(x), m = m || "application/json"), 
        !l && m && (p[d] = m)) : o.isFormData(x) && delete p[d];
        var v = a.timeout;
        a = {
            url: s,
            data: x,
            headers: p,
            method: n.toUpper(f),
            withCredentials: a.withCredentials
        }, v && (a.timeout = v);
        var q = Promise.resolve(a);
        return q = this.interceptors.request.intercept(q).then(function(e) {
            return r.adapter.call(r, e);
        }).then(function(e) {
            if (n.isString(e.data) && !r.axios) {
                var t = e.data;
                try {
                    e.data = JSON.parse(e.data);
                } catch (r) {
                    e.data = t;
                }
            }
            return e.config = a, e.headers = n.mapKeys(e.headers, function(e, t) {
                return n.toLower(t);
            }), e;
        }), q = this.interceptors.response.intercept(q);
    }, m.adapter = function(e) {
        var t = this.defaults;
        return t.wx ? s.wx.call(this, e) : t.axios ? s.axios.call(this, e) : t.jQuery ? s.jquery.call(this, e) : t.quickapp ? s.quickapp.call(this, e) : "function" == typeof XMLHttpRequest ? s.xhr.call(this, e) : void 0;
    }, n.each(f, function(e) {
        m[e] = function(t, r) {
            return this.request(n.extend({
                method: e,
                url: t
            }, r));
        };
    }), n.each(h, function(e) {
        m[e] = function(t, r, i) {
            return this.request(n.extend({
                url: t,
                method: e,
                data: r
            }, i));
        };
    }), t.exports = l;
}, function(e) {
    return n({
        "./queue": 1553308811264,
        "./utils": 1553308811265,
        "./adapters": 1553308811266
    }[e], e);
}), r(1553308811264, function(t, r, n) {
    var i = t("min-util");
    function u() {
        this.queue = [];
    }
    r.exports = u, i.extend(u.prototype, {
        use: function() {
            for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++) t[r] = arguments[r];
            return this.queue.push(t), this;
        },
        intercept: function(t) {
            return i.reduce(this.queue, function(t, r) {
                return t.then.apply(t, e(r));
            }, t);
        }
    });
}, function(e) {
    return n({}[e], e);
}), r(1553308811265, function(e, t, r) {
    var n = e("min-util"), i = new RegExp("Content-Type", "i");
    r.CONTENT_TYPE_KEY = "Content-Type", r.getContentType = function(e) {
        var t = n.keys(e);
        return e[n.find(t, function(e) {
            return i.test(e);
        })];
    }, r.parseHeadersFromXhr = function(e) {
        return n.chain(e.getAllResponseHeaders()).trim().split("\n").reduce(function(e, t) {
            var r = n.indexOf(t, ":"), i = n.toLower(n.trim(n.slice(t, 0, r))), u = n.trim(n.slice(t, r + 1));
            return e[i] ? e[i] = "," + u : e[i] = u, e;
        }, {}).value();
    }, r.isFormData = function(e) {
        return "undefined" != typeof FormData && e instanceof FormData;
    }, r.timeout = function e(t) {
        return new Promise(function(r, n) {
            e && setTimeout(function() {
                n(new Error("timeout"));
            }, t);
        });
    }, r.clearTimer = function(e) {
        e && clearTimeout(e);
    }, r.createError = function(e, t) {
        var r = new Error(e);
        return n.extend(r, t), r;
    };
}, function(e) {
    return n({}[e], e);
}), r(1553308811266, function(e, t, r) {
    var n = e("./wx"), i = e("./quickapp"), u = e("./axios"), a = e("./jquery"), o = e("./xhr");
    r.wx = n, r.quickapp = i, r.axios = u, r.jquery = a, r.xhr = o;
}, function(e) {
    return n({
        "./wx": 1553308811267,
        "./quickapp": 1553308811268,
        "./axios": 1553308811269,
        "./jquery": 1553308811270,
        "./xhr": 1553308811271
    }[e], e);
}), r(1553308811267, function(e, t, r) {
    var n = e("../utils");
    t.exports = function(e) {
        var t, r = this.defaults;
        if (r && r.wx) return new Promise(function(i, u) {
            var a = r.wx.request({
                url: e.url,
                data: e.data,
                header: e.headers,
                method: e.method,
                success: function(e) {
                    n.clearTimer(t);
                    var r = e.data, u = e.statusCode, a = e.header;
                    i({
                        data: r,
                        status: u,
                        headers: a
                    });
                },
                fail: function(e) {
                    n.clearTimer(t), u(e);
                }
            });
            e.timeout && (t = setTimeout(function() {
                a && a.abort && a.abort, u(n.createError("timeout"));
            }, e.timeout));
        });
    };
}, function(e) {
    return n({
        "../utils": 1553308811265
    }[e], e);
}), r(1553308811268, function(e, t, r) {
    var n = e("../utils");
    t.exports = function(e) {
        var t = this.defaults;
        if (t && t.quickapp) return new Promise(function(r, i) {
            t.quickapp.fetch({
                url: e.url,
                data: e.data,
                header: e.headers,
                method: e.method,
                success: function(e) {
                    n.clearTimer(timer);
                    var t = e.data, i = e.code, u = e.headers;
                    r({
                        data: t,
                        status: i,
                        headers: u
                    });
                },
                fail: function(e, t) {
                    n.clearTimer(timer), i({
                        data: e,
                        code: t
                    });
                }
            }), e.timeout && (timer = setTimeout(function() {
                i(n.createError("timeout"));
            }, e.timeout));
        });
    };
}, function(e) {
    return n({
        "../utils": 1553308811265
    }[e], e);
}), r(1553308811269, function(e, t, r) {
    t.exports = function(e) {
        var t = this.defaults;
        if (t && t.axios) return t.axios.request(e).then(function(e) {
            return e;
        });
    };
}, function(e) {
    return n({}[e], e);
}), r(1553308811270, function(e, t, r) {
    var n = e("../utils");
    t.exports = function(e) {
        var t = this.defaults;
        if (t && t.jQuery) return new Promise(function(r, i) {
            t.jQuery.ajax({
                url: e.url,
                data: e.data,
                headers: e.headers,
                method: e.method,
                timeout: e.timeout,
                withCredentials: e.withCredentials,
                success: function(e, t, i) {
                    r({
                        data: e,
                        status: 200,
                        headers: n.parseHeadersFromXhr(i)
                    });
                },
                error: function(e, t, r) {
                    i(n.createError(r, {
                        response: e,
                        textStatus: t
                    }));
                }
            });
        });
    };
}, function(e) {
    return n({
        "../utils": 1553308811265
    }[e], e);
}), r(1553308811271, function(e, t, r) {
    var n = e("../utils");
    t.exports = function(e) {
        return new Promise(function(t, r) {
            var i = new XMLHttpRequest();
            i.onload = function(e) {
                t({
                    status: i.status,
                    data: i.responseText,
                    headers: n.parseHeadersFromXhr(i)
                });
            }, i.ontimeout = function(e) {
                r(n.createError("timeout"));
            }, i.onerror = function(e) {
                r(n.createError("error"));
            }, i.open(e.method, e.url, !0), e.timeout && (i.timeout = e.timeout), e.withCredentials && (i.withCredentials = e.withCredentials), 
            _.forIn(e.headers, function(e, t) {
                i.setRequestHeader(t, e);
            }), i.send(e.data);
        });
    };
}, function(e) {
    return n({
        "../utils": 1553308811265
    }[e], e);
}), n(1553308811261));